import InstallCommon
import os




def InstallOSPackages(): 
    print "Install Needed Operating System Packages?  Y/N"
    Response = raw_input().lower()
    if(not ('y' in Response)):
        return
   
    os.system("apt-get update")
    os.system("apt-get install idle -y")
    os.system("apt-get install pgadmin3 -y")

    os.system("apt-get install apache2 -y")
    os.system("apt-get install apache2-mpm-prefork -y")
    os.system("apt-get install cgi-mapserver -y")

    os.system("apt-get install libapache2-mod-wsgi -y")
    os.system("apt-get install mapserver-bin -y")

    os.system("apt-get install postgresql-9.3 -y")
    os.system("apt-get install python-mysqldb -y")
    os.system("apt-get install python-psycopg2 -y")
    os.system("apt-get install vsftpd -y")
    os.system("apt-get install wput -y")
    os.system("apt-get install postgis -y")
    os.system("apt-get install libfreetype6-dev -y")
    os.system("apt-get install python-dev -y")
    os.system("apt-get install libaio1 -y")
    os.system("apt-get install libaio-dev -y")
    os.system("apt-get install python-reportlab -y")
    os.system("apt-get install python-pip -y")

    os.system("sudo pip install -U pip") #Updated to latest pip
    os.system("sudo pip install Django==1.6.5")
    os.system("apt-get install postgresql-9.3-postgis-scripts -y")


def PerformDjangoHacks():
    print "Perform Django Hacks [Edit Max_Length of /usr/lib/python2.7/dist-packages/django/contrib/auth/models.py?"
    Response = raw_input().lower()
    if('y' in Response):
        FileName = '/usr/local/lib/python2.7/dist-packages/django/contrib/auth/models.py'
        os.system("sed -i 's/max_length=50/max_length=200/g' " + FileName)
        os.system("sed -i 's/max_length=100/max_length=250/g' " + FileName)
